package com.fzq.userserver.userserver.utils;

import com.fzq.userserver.userserver.enums.ResultEnum;
import com.fzq.userserver.userserver.vo.ResultVO;

public class ResultVOUtil {

    public static ResultVO success(Object object) {
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(0);
        resultVO.setMsg("登陆成功");
        resultVO.setData(object);
        return resultVO;
    }

    public static ResultVO success() {
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(0);
        resultVO.setMsg("登陆成功");
        return resultVO;
    }

    public static ResultVO error(ResultEnum resultEnum) {
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(resultEnum.LOGIN_FAIL.getCode());
        resultVO.setMsg("登陆失败");
        return resultVO;
    }
}
